Skip to content

[extensions] Add RLS policies to family-calendar#232

Open
AnkitClassicVision wants to merge 4 commits intoNateBJones-Projects:mainfrom
AnkitClassicVision:contrib/AnkitClassicVision/family-calendar-rls
Open

[extensions] Add RLS policies to family-calendar#232
AnkitClassicVision wants to merge 4 commits intoNateBJones-Projects:mainfrom
AnkitClassicVision:contrib/AnkitClassicVision/family-calendar-rls

Conversation

@AnkitClassicVision
Copy link
Copy Markdown

Summary

  • Enables Row Level Security on all three family-calendar tables (family_members, activities, important_dates)
  • Policies: auth.uid() = user_id for user access + service_role bypass
  • Updates the README note to reflect the shift: family-calendar data is personal enough that tenant isolation is worth turning on from the start

Why

Extensions 1-3 were originally framed as single-user systems where RLS isn't strictly required until Extension 4 (Meal Planning). But family-calendar data (kids' schedules, medical appointments, birthdays) is sensitive enough that it's worth defending at the database layer from day one — especially as users may eventually connect multiple clients or share limited views.

The RLS shape mirrors Extension 4's pattern exactly, so the learning path still flows naturally: users see RLS once here, then learn why it matters for shared household access in Extension 4.

Test plan

  • Apply schema.sql to a fresh Supabase project
  • Verify RLS is enabled on all three tables (SELECT relrowsecurity FROM pg_class WHERE relname IN ('family_members','activities','important_dates'))
  • Verify a non-service-role JWT with auth.uid() = user_X can only read/write their own rows
  • Verify service_role bypasses correctly

🤖 Generated with Claude Code

AnkitClassicVision and others added 4 commits April 22, 2026 14:03
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove duplicated MyBCAT Universal Rules block from repo CLAUDE.md.
Rules are now inherited via /repos/.claude/CLAUDE.md (Claude Code walks
up the directory tree). Saves ~1,165 tokens per session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enables row-level security on family_members, activities, and important_dates
with a user-scoped policy (auth.uid() = user_id) plus a service_role bypass.
Updates the README note to reflect the shift — family-calendar data is personal
enough that tenant isolation is worth having on from day one, even though the
learning path doesn't strictly require RLS until Extension 4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation extension Contribution: curated learning path build recipe Contribution: step-by-step recipe labels Apr 23, 2026
@github-actions
Copy link
Copy Markdown

Hey @AnkitClassicVision — welcome to Open Brain Source! 👋

Thanks for submitting your first PR. The automated review will run shortly and check things like metadata, folder structure, and README completeness. If anything needs fixing, the review comment will tell you exactly what.

Once the automated checks pass, a human admin will review for quality and clarity. Expect a response within a few days.

If you have questions, check out CONTRIBUTING.md or open an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation extension Contribution: curated learning path build recipe Contribution: step-by-step recipe

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant